package com.fenghongzhang.day014;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.app.Dialog;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.Toast;

import com.ashokvarma.bottomnavigation.BottomNavigationBar;
import com.ashokvarma.bottomnavigation.BottomNavigationItem;

public class MainActivity extends AppCompatActivity {
    private MyBottomBar bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        bar = (MyBottomBar) findViewById(R.id.bar);
        bar.addItem(new MyItem().setName("首页")).addItem(new MyItem().setDrawable(getDrawable(R.mipmap.ic_launcher)))
                .addItem(new MyItem().setName("电影"))
                .build();

        bar.setBackColor(Color.GRAY);

        bar.setMyListener(new MyBottomBar.MyListener() {
            @Override
            public void selectedClick(int postion) {
                Toast.makeText(MainActivity.this, ""+postion, Toast.LENGTH_SHORT).show();
                bar.selected(postion);
            }
        });










//        BottomNavigationBar bottomNavigationBar = new BottomNavigationBar();
//        new BottomNavigationItem().setActiveColor().setBadgeItem().setInActiveColorResource()
//        bottomNavigationBar.addItem().initialise();
//        new MyItem().setName("").set;


//        AlertDialog show = new AlertDialog.Builder().setMessage("haha").adddree("haha").show();
    }
}
